﻿////////////////////////////////////////////////////////////////////////
//Autor: Gabriel Tame Borao  - gabrieltame@yahoo.es 
//Fecha: 2010/09/15 01:26
//Solucion: GTameReport.sln
//Proyecto: GTameReport
//Fichero: ReportItemsTypeSingle.cs
//
//	Copyright (C) 2010  Gabriel Tame Borao (GTB)
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////
namespace GTameReport
{
    using Rdl;
    using System;
    using System.Collections;

    public class ReportItemsTypeSingle
    {
        private GTameReport.ChartType _Chart;
        private GTameReport.CustomReportItemType _CustomReportItem;
        private GTameReport.ImageType _Image;
        private GTameReport.LineType _Line;
        private GTameReport.ListType _List;
        private GTameReport.MatrixType _Matrix;
        private GTameReport.RectangleType _Rectangle;
        private GTameReport.SubreportType _Subreport;
        private GTameReport.TableType _Table;
        private GTameReport.TextboxType _Textbox;

        public ReportItemsType Write()
        {
            ReportItemsType type = new ReportItemsType();
            ArrayList list = new ArrayList();
            if (this._Chart != null)
            {
                list.Add(this._Chart.Write());
            }
            if (this._CustomReportItem != null)
            {
                list.Add(this._CustomReportItem.Write());
            }
            if (this._Image != null)
            {
                list.Add(this._Image.Write());
            }
            if (this._Line != null)
            {
                list.Add(this._Line.Write());
            }
            if (this._List != null)
            {
                list.Add(this._List.Write());
            }
            if (this._Matrix != null)
            {
                list.Add(this._Matrix.Write());
            }
            if (this._Rectangle != null)
            {
                list.Add(this._Rectangle.Write());
            }
            if (this._Subreport != null)
            {
                list.Add(this._Subreport.Write());
            }
            if (this._Table != null)
            {
                list.Add(this._Table.Write());
            }
            if (this._Textbox != null)
            {
                list.Add(this._Textbox.Write());
            }
            type.Items = list.ToArray();
            list = null;
            return type;
        }

        public GTameReport.ChartType Chart
        {
            get
            {
                if (this._Chart == null)
                {
                    this._Chart = new GTameReport.ChartType();
                }
                return this._Chart;
            }
            set
            {
                this._Chart = value;
            }
        }

        public GTameReport.CustomReportItemType CustomReportItem
        {
            get
            {
                if (this._CustomReportItem == null)
                {
                    this._CustomReportItem = new GTameReport.CustomReportItemType();
                }
                return this._CustomReportItem;
            }
            set
            {
                this._CustomReportItem = value;
            }
        }

        public GTameReport.ImageType Image
        {
            get
            {
                if (this._Image == null)
                {
                    this._Image = new GTameReport.ImageType();
                }
                return this._Image;
            }
            set
            {
                this._Image = value;
            }
        }

        public GTameReport.LineType Line
        {
            get
            {
                if (this._Line == null)
                {
                    this._Line = new GTameReport.LineType();
                }
                return this._Line;
            }
            set
            {
                this._Line = value;
            }
        }

        public GTameReport.ListType List
        {
            get
            {
                if (this._List == null)
                {
                    this._List = new GTameReport.ListType();
                }
                return this._List;
            }
            set
            {
                this._List = value;
            }
        }

        public GTameReport.MatrixType Matrix
        {
            get
            {
                if (this._Matrix == null)
                {
                    this._Matrix = new GTameReport.MatrixType();
                }
                return this._Matrix;
            }
            set
            {
                this._Matrix = value;
            }
        }

        public GTameReport.RectangleType Rectangle
        {
            get
            {
                if (this._Rectangle == null)
                {
                    this._Rectangle = new GTameReport.RectangleType();
                }
                return this._Rectangle;
            }
            set
            {
                this._Rectangle = value;
            }
        }

        public GTameReport.SubreportType Subreport
        {
            get
            {
                if (this._Subreport == null)
                {
                    this._Subreport = new GTameReport.SubreportType();
                }
                return this._Subreport;
            }
            set
            {
                this._Subreport = value;
            }
        }

        public GTameReport.TableType Table
        {
            get
            {
                if (this._Table == null)
                {
                    this._Table = new GTameReport.TableType();
                }
                return this._Table;
            }
            set
            {
                this._Table = value;
            }
        }

        public GTameReport.TextboxType Textbox
        {
            get
            {
                if (this._Textbox == null)
                {
                    this._Textbox = new GTameReport.TextboxType();
                }
                return this._Textbox;
            }
            set
            {
                this._Textbox = value;
            }
        }
    }
}

